package com.damai.utils;

import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;

import com.damai.plugins.BaseJob;

public class QuartzJob extends BaseJob {
	
	public static final String LISTENER = "listener";
	
	
	public static interface QuartzJobListener{
		void onExcecuteJob(JobExecutionContext context) throws JobExecutionException;
	}

	@Override
	protected void doJob(JobExecutionContext context) throws JobExecutionException {
		QuartzJobListener listener = (QuartzJobListener) context.getJobDetail().getJobDataMap().get(QuartzJob.LISTENER);
		listener.onExcecuteJob(context);
	}

}
